package cn.lopr.im.android.db.entity;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;

import java.io.Serializable;

/**
 * @author shuangyang7
 * @date 2020/12/20 17:43
 */
@Entity()
public class Message implements Serializable {
    private static final long serialVersionUID = -8794210544854464481L;
    @Id(autoincrement = true) //主键  //autoincrement 开启自增
    public Long id;

    public int type;
    public String fromUser;
    public String toUser;
    public String date;
    public String msg;
    public String groupId;
    public int isRead;

    @Generated(hash = 1653846318)
    public Message(Long id, int type, String fromUser, String toUser, String date,
                   String msg, String groupId, int isRead) {
        this.id = id;
        this.type = type;
        this.fromUser = fromUser;
        this.toUser = toUser;
        this.date = date;
        this.msg = msg;
        this.groupId = groupId;
        this.isRead = isRead;
    }

    @Generated(hash = 637306882)
    public Message() {
    }

    public Long getId() {
        return this.id;
    }

    public Message setId(Long id) {
        this.id = id;
        return this;
    }

    public int getType() {
        return this.type;
    }

    public Message setType(int type) {
        this.type = type;
        return this;
    }

    public String getFromUser() {
        return this.fromUser;
    }

    public Message setFromUser(String fromUser) {
        this.fromUser = fromUser;
        return this;
    }

    public String getToUser() {
        return this.toUser;
    }

    public Message setToUser(String toUser) {
        this.toUser = toUser;
        return this;
    }

    public String getDate() {
        return this.date;
    }

    public Message setDate(String date) {
        this.date = date;
        return this;
    }

    public String getMsg() {
        return this.msg;
    }

    public Message setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public String getGroupId() {
        return this.groupId;
    }

    public Message setGroupId(String groupId) {
        this.groupId = groupId;
        return this;
    }

    public int getIsRead() {
        return this.isRead;
    }

    public Message setIsRead(int isRead) {
        this.isRead = isRead;
        return this;
    }

    @Override
    public String toString() {
        return "Message{" +
                "id=" + id +
                ", type=" + type +
                ", fromUser='" + fromUser + '\'' +
                ", toUser='" + toUser + '\'' +
                ", date='" + date + '\'' +
                ", msg='" + msg + '\'' +
                ", groupId='" + groupId + '\'' +
                ", isRead=" + isRead +
                '}';
    }
}
